package com.baomidou.mybatisplus.criterion;

/**
 * Constrains a property to between two values
 * @author Timothy Ren
 */
public class BetweenExpression implements QueryCriterion {

	private static final long serialVersionUID = 1L;
	private final String propertyName;
	private final Object lo;
	private final Object hi;

	protected BetweenExpression(String propertyName, Object lo, Object hi) {
		this.propertyName = propertyName;
		this.lo = lo;
		this.hi = hi;
	}

	public String toSqlString() {
		return " between ? and ?";
	}

	public Object[] getValueArr() {
		return new Object[] { lo, hi };
	}

	public String toString() {
		return propertyName + " between " + lo + " and " + hi;
	}

}
